{template header}
<style type="text/css">
.table1 tr.cur td { background:#ECF6FA; }
.table1a td{background:#d1eef9; }

.iptxt{width:30px;}

.table1 { width: 100%;background:#B9D1E3;}
.table1 tbody { padding-left: 20px; }
.table1 tr {border-bottom:1px dotted #CCC;  }
.table1 td { border-bottom: 1px dotted #CCC; text-align: center; height:25px; line-height:25px; }
.table1 th { border-bottom: 1px solid #CCC;  text-align: center; color: #1A5499; }
.table1 th a { text-decoration: none; color:#1A5499; }
.table1 th a:hover { text-decoration: underline; color: #FF6600; }
.textareasss{ width:300px; height:40px;}
.textare11{width:50px; height:25px;}
</style>
<script language="javascript">
	J(function(){
	
		bopuruiObj.command.mtabletr();
		bopuruiObj.command.selectBoxAll();
		
		J('input[name=productId[]]').each( function(){
		
			J('#bz_'+this.value).bind('click', {id:this.value}, function(c){
				var rsw = J('#bz_'+c.data.id).html();

				if(rsw.indexOf('<') < 0 ){
					J('#bz_'+c.data.id).html('<textarea name=bz'+c.data.id+' id=bz'+c.data.id+' rows=2 class="textareasss">'+rsw+'</textarea>');
				}
				
				J('#bz'+c.data.id).focus();
				
				J('#bz'+c.data.id).bind('blur',{id:c.data.id},
						function(c){
							var str = this.value;
							J.ajax({
							   type: "POST",
							   url: "product-update.htm?updatetype=ajaxupdate&productId="+c.data.id,
							   data: "content="+encodeURIComponent(str)+"",
							   cache: false,
							   beforeSend : function(){J('#bz_'+c.data.id).html("<img src=../../images/common/loading.gif />");},
							   success: function(text){
								  
									J('#bz_'+c.data.id).html(text);
								   
							   },
							   ajaxError: function(){alert('发生错误，请刷新后重试!');}
							}); 
					});
				
			});
		
	});
		
	
	J('input[name=productId[]]').each( function(){
		
			J('#px_'+this.value).bind('click', {id:this.value}, function(c){
				var rsw = J('#px_'+c.data.id).html();

				if(rsw.indexOf('<') < 0 ){
					J('#px_'+c.data.id).html('<textarea name=px'+c.data.id+' id=px'+c.data.id+' rows=2 class="textare11">'+rsw+'</textarea>');
				}
				
				J('#px'+c.data.id).focus();
				
				J('#px'+c.data.id).bind('blur',{id:c.data.id},
						function(c){
							var str = this.value;
							J.ajax({
							   type: "POST",
							   url: "product-update.htm?updatetype=ajaxsort&productId="+c.data.id,
							   data: "productSort="+encodeURIComponent(str)+"",
							   cache: false,
							   beforeSend : function(){J('#px_'+c.data.id).html("<img src=../../images/common/loading.gif />");},
							   success: function(text){
								  
									J('#px_'+c.data.id).html(text);
								   
							   },
							   ajaxError: function(){alert('发生错误，请刷新后重试!');}
							}); 
					});
				
			});
		
	});
	
	
	
		J('input[name=keyword]').bind('click',function(){
			if(J(this).val()==''||J(this).val()=='输入订货号或产品说明'){
				J(this).val('').removeClass('Em');
			}		
		}).bind('blur',function(){
			if(J(this).val()==''){
				J(this).val('输入订货号或产品说明').addClass('Em');;
			}		
		});
		
		J('.bigButton').click(function(){
			J('#keyword').val(J('#keyword').val().replace('输入订货号或产品说明',''));
		});
	})
</script>

<div class="path">
	<span>产品管理</span>
	<span><a href="product-create.htm">添加产品</a></span>
</div>
<div class="content">
	<div class="c1">
	<div style="border:1px #B9D1E3 solid; background:#FFFFFF">
	<form action="product-admin.htm" method="get">
		<table width="100%" cellspacing="5" cellpadding="5">
			<tr>
				<td width="115" align="right">分类：</td>
				<td width="328">
				<select name="categoryId" id="selectStyle" class="in_text_cla1">
					<option value="0">全部类别...</option>
					<!--{loop $optionListArr $list}-->
					<option value="{$list[categoryId]}" {if $categoryId==$list[categoryId]}selected="selected"{/if}>{$list[cateName]}</option>
					<!--{/loop}-->
				</select>				</td>
			  <td width="188">
				<input class="SearchTextb Em" name="keyword" id="keyword" type="text" value="{if $keyword!=''}$keyword{else}输入订货号或产品说明{/if}" />				</td>
				<td width="531" align="left"><input type="submit" name="submitTo_search" value=" 搜 索 " class="bigButton" /></td>
			</tr>
		</table>
	</form>
	</div>
	<br />
	<form action="product-alldelete.htm" method="post" name="form1">
	      <table width="100%" border="0" cellspacing="1" cellpadding="2" class="table1" style="text-align:center">
	        <tr>
	          <th width="7%">&nbsp;</th>
	          <th width="6%">ID</th>
	          <th width="12%">订货号</th>
	          <!--<th width="7%">产品图片</th>-->
	          <th width="16%">产品分类</th>
	          <th width="34%">产品说明</th>
	          <th width="6%">排序</th>
	          <th width="9%">市场价格</th>
	          <th width="10%">操作</th>
            </tr>
		<!--{loop $products $v}-->
		<tr>
		  <td height="23" align="center"><input type="checkbox" name="productId[]" Tags="mark" value="<!--{$v[productId]}-->" /></td>
			<td><!--{$v[productId]}-->&nbsp;</td>
			<td><a href="{GODHOUSE_DOMAIN_WWW}product-detail-$v[categoryId].htm" target="_blank">$v[promotions]<!--{$v[productNo]}--></a></td>
			<td><!--{$v[categoryName]}--></td>
			<td id="bz_$v[productId]">{$v[content]}</td>
			<td id="px_$v[productId]">{$v[productSort]}</td>
			<td>￥{$v[ourPrice]}</td>
			<td><a href="product-update.htm?productId={$v[productId]}">编辑</a> <a href="javascript:if(confirm('确定是否要删除吗?')){location.href='product-delete.htm?productId=$v[productId]';}">删除</a></td>
		</tr>
		<!--{/loop}-->
		<tr>
			<td colspan="2"><label><input type="checkbox" id="selectAll" value="all" />全选</label></td>
		    <td colspan="6" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="批量删除" />&nbsp;</td>
		</tr>
		<tr>
		  <td colspan="10">$multipage</td>
		  </tr>
	      </table>
      </form>
	</div>
</div>
{template footer}